/*
 * @(#)Coordinator.java	1.0 2000/12/14
 *
 * Copyright 2000 Thomas Barnekow. All Rights Reserved.
 *
 * This software is the proprietary information of Thomas Barnekow.
 * Use is subject to license terms.
 */

package tb.jots;

/**
 * This interface corresponds to the <code>CosTransactions::Coordinator</code> IDL interface.
 *
 * @author Thomas Barnekow
 * @version 1.0
 */
public interface Coordinator {

  /**
   * Get transaction status.
   *
   * @see OTS
   */
	public int getStatus();

  /**
   * Compare transaction coordinators.
   */
	public boolean isSameTransaction(Coordinator c);

  /**
   * Register a {@link Resource} participating in a transaction coordinated by
   * this coordinator.
   *
   * @exception NoPermissionException
   * @exception InactiveException
   * @exception TransactionRolledBackException
   */
	public void registerResource(Resource r) throws JotsException;

  /**
   * Set current transaction's status to {@link OTS#STATUS_MARKED_ROLLBACK}, so that it
   * can only be rolled back.
   *
   * @exception NoPermissionException
   * @exception InactiveException
   *
   * @see Current#rollbackOnly
   */
	public void rollbackOnly() throws JotsException;
}
